<?php

// +----------------------------------------------------------------------
// | OneThink [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: 麦当苗儿 <zuojiazi@vip.qq.com> <http://www.zjzit.cn>
// +----------------------------------------------------------------------

namespace Home\Controller;
use OT\DataDictionary;
use Think\Model;

/**
 * 前台首页控制器
 * 主要获取首页聚合数据
 */
class PublicController extends HomeController{
    var $uid;
    function _initialize(){
        parent::_initialize();
        $this->uid=get_uid();

    }
    public function base(){
        $User = M("usermenu");
        $arrmenu = $User->where()->select();
        $User = M("member");
        $arruser = $User->where(array('uid' => $this->uid))->select();
        // dump($User->getLastSql());
        $User = M("usermenu_title");
        $arrtitle = $User->where()->select();
        foreach ($arrmenu as $v) {
            $v;
            //  print_r($v);
            foreach ($arrtitle as $x) {
                if ($v["menuid"] == $x["menuid"]) {
                    $x;
                    //    print_r($x);
                }
            }
        }
        $this->assign("arruser", $arruser);
        $this->assign("arrmenu", $arrmenu);
        $this->assign("arrtitle", $arrtitle);
    }
}